home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / August 96 / Re ODF and printing (II) < prev    next >
Encoding:
Internet Message Format  |  1996-08-09  |  2.4 KB  |  [TEXT/ttxt]

  1. Subject:     Re: ODF and printing (II)
  2. Sent:        8/8/96 1:45 AM
  3. Received:    8/8/96 8:57 AM
  4. From:        Oliver Breidenbach, oliver@boinx.com
  5. Reply-To:    ODF Interest, ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8. ((Sorry if this is a resent, somehow Cyberdog decided to send the
  9. incomplete first draft. I changed a lot!))
  10.  
  11. Henri,
  12.  
  13. >Did you try to print your part using another container (ODFDraw) or 
  14. >implement printing in your part and check what was the output.
  15.  
  16. thanks for your reply. Yes, I checked printing with ODFDraw R1 and got
  17. the same result. No, we did not implement printing ourselves. I had a
  18. look at the docmentation for implementing printing, but it only deals
  19. with the problem of not rendering certain portions of your view and
  20. changing the print dialogs. It does not talk about the precision of
  21. positioning graphical objects.
  22.  
  23. As I said we just changed the Hello demo part code:
  24.  
  25. void CLotsOSwimmersFrame::Draw(Environment *ev, ODFacet* odFacet,
  26. ODShape* invalidShape)    // Override
  27. {
  28.     FW_CViewContext fc(ev, this, odFacet, invalidShape);
  29.     FW_CRect invalidRect;
  30.     fc.GetClipRect(invalidRect);
  31.  
  32.     FW_CRectShape::RenderRect(fc, invalidRect, FW_kFill,
  33. FW_kWhiteEraseInk);
  34.  
  35.     FW_CRect lotsoSwimmersRect = GetBounds(ev);
  36.     
  37.     FW_CPoint myX = lotsoSwimmersRect.TopLeft();
  38.     FW_CPoint myY = lotsoSwimmersRect.BotLeft();
  39.  
  40. // If you change the steps here, you see the effect!
  41.  
  42.     for (float y = 0.5; y < 25.0; y = y + 1.1) 
  43.     {
  44.         FW_CRect myRect = FW_CRect( myX + FW_CPoint(FW_DoubleToFixed(y), 
  45. FW_DoubleToFixed( 5.0)), myY + FW_CPoint(FW_DoubleToFixed(y + 0.3), 
  46. FW_DoubleToFixed(-25.0)));
  47.     
  48.         FW_CRectShape::RenderRect(fc, myRect, FW_kFill,
  49. FW_CInk(FW_kRGBBlack));
  50.     }
  51. }
  52.  
  53. In the printing documentation it says that we can determine if the
  54. draw method is called for rendering on screen or on printer. However,
  55. I did not find how we can change the behavior of
  56. FW_CRectShape::RenderRect to use a higher resolution to position the
  57. Rectangles on the LaserWriter.
  58.  
  59. As I said, we just started with ODF the day before yesterday to
  60. evaluate if we can use it. So we may not have read the critical stuff
  61. in the documentation yet. So I asumed that FW_CRectShape::RenderRect
  62. would take care of the transformation for different resolution
  63. outputs.
  64.  
  65. Can someone point me to information on how to use a higher resolution
  66. on printer output? Any help is appreciated. Thanks in advance.
  67.  
  68. Cheers,
  69.  
  70. Oliver.
  71.  
  72.  
  73.